package com.wz.dhs.model;

import com.wz.dhs.model.common.Result;
import com.wz.dhs.model.common.ResultCode;
import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
public class UserAuthAccessDeniedHandler implements AccessDeniedHandler {

     /**
       * @Author xyb
       * @Description //无权限返回
       * @Date 14:55 2022/7/14
       * @Param
       * @return
       **/
    @Override
    public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, org.springframework.security.access.AccessDeniedException e){
        ResultUtil.responseJson(httpServletResponse, Result.fail(ResultCode.AUTH_THROITY_FAIL));
    }
}
